package com.example.binpacking.service.Impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.binpacking.mapper.QuestionnaireOptionMapper;
import com.example.binpacking.model.QuestionnaireItem;
import com.example.binpacking.model.QuestionnaireOption;
import com.example.binpacking.service.QuestionnaireOptionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;

@Service
public class QuestionnaireOptionServiceImpl extends ServiceImpl<QuestionnaireOptionMapper, QuestionnaireOption> implements QuestionnaireOptionService {
    @Autowired
    private QuestionnaireOptionMapper questionnaireOptionMapper;

    @Override
    public Page<QuestionnaireOption> selectByDeletedAndItem(BigDecimal itemid, BigDecimal isdeleted, int current, int size) {
        return questionnaireOptionMapper.selectByDeletedAndItem(new Page<>(current, size),isdeleted,itemid);
    }

    @Override
    public int updateNameById(BigDecimal id, String name) {
        return questionnaireOptionMapper.updateNameById(id,name);
    }

    @Override
    public int updateDeletedById(BigDecimal id, BigDecimal isdeleted) {
        return questionnaireOptionMapper.updateDeletedById(id,isdeleted);
    }
}
